package portfelo.objects;

import java.sql.Date;

public class Image 
{
//	(HOTO_ID INT AUTO_INCREMENT NOT NULL PRIMARY KEY, 
//	URL_LOCATION VARCHAR(300) NOT NULL, --URL LINK TO THE IMAGE
//	FULLY_QUALIFIED_NAME VARCHAR(120) NOT NULL, --?????
//	ACCOUNT_ID INT NOT NULL, --ACCOUNT THAT UPLOADED THE PHOTO
//	LOCATION VARCHAR(60), --LOCATION IMAGE WAS TAKEN
//	TITLE VARCHAR(60), --TITLE OF THE IMAGE
//	DATE_TAKEN DATE, --DATE THE PHOTO WAS TAKEN (ALTERNATIVE, IS DATE PHOTO UPLOADED)
//	FOREIGN KEY(ACCOUNT_ID) REFERENCES ACCOUNT(ACCOUNT_ID)
	private int id;
	private String url;
	private String fullQualifiedName;
	private int account_id;
	private String location;
	private String title;
	private Date date;
	
	public Image(int id, String url, String fqn, int accId, String loc, String title, Date date)
	{
		this.id = id;
		this.url = url;
		fullQualifiedName = fqn;
		account_id = accId;
		location = loc;
		this.title = title;
		this.date = date;
	}
	
	public int getId()
	{return id;}
	public String getUrl()
	{return url;}
	public int getAccountId()
	{return account_id;}
	public String getFullQualifiedName()
	{return fullQualifiedName;}
	public String getLocation()
	{return location;}
	public String getTitle()
	{return title;}
	public Date getDate()
	{return date;}
	
	public boolean equals(Object o)
	{
		if(!(Image.class.isInstance(o)))
			return false;
		
		Image t = (Image) o;
		
		//id is unique primary key, therefore if the id is same then the rest of image is same
		return id == t.getId();
		
//		return (id == t.getId() && url.equals(t.getUrl()) && account_id == t.getAccountId() && 
//				fullQualifiedName.equals(t.getFullQualifiedName()) && 
//				location.equals(t.getLocation()) && title.equals(t.getTitle()) && date.equals(t.getTitle()));
	}

}
